﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdvancedSearch.aspx.cs" Inherits="BEGDC.CC.Web.EZVisit.AdvancedSearch" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="uc1" TagName="PageNavigation" Src="~/UserControls/PageNavigation.ascx" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>EZVisit-Advanced Search</title>
    <link href="../css/global.css" type="text/css" rel="stylesheet" />
    <link href="../css/ezform.css" rel="stylesheet" type="text/css" />
    <link href="../css/content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../js/jquery-ui.min.js" type="text/javascript"></script>

</head>
<body class="purple-bg">
    <uc1:PageNavigation ID="PageNavigation1" runat="server"></uc1:PageNavigation>
    <div class="tab-box purplebg_dark">
        <ul class="tab-pos">
            <li><span class="tab-active">Advanced Search 高级查询</span></li>
        </ul>
    </div>
    <form id="Form1" method="post" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="fw formbox">
        <table cellspacing="0" cellpadding="0" width="100%" class="ev-table">
            <tr class="ev-row">
                <td class="title">
                    EZVisit No. EZVisit单号：
                </td>
                <td class="val">
                    <asp:TextBox ID="txtEZVisitReqNo" runat="server" CssClass="width140 txtbox" />
                </td>
                <td class="title">
                    Application No. 申请单号：
                </td>
                <td class="val">
                    <asp:TextBox ID="txtAppNo" runat="server" CssClass="width140 txtbox" />
                </td>
            </tr>
            <tr class="ev-row">
                <td class="title">
                    Process Status 状态：
                </td>
                <td class="val">
                    <asp:DropDownList ID="ddlStatus" runat="server" CssClass="width146">
                        <asp:ListItem Value="all" Text="All"></asp:ListItem>
                        <asp:ListItem Value="Draft" Text="Draft"></asp:ListItem>
                        <asp:ListItem Value="In Process" Text="In Process"></asp:ListItem>
                        <asp:ListItem Value="LGDApproved" Text="Approved"></asp:ListItem>
                        <asp:ListItem Value="Approved" Text="Closed"></asp:ListItem>
                        <asp:ListItem Value="Rejected" Text="Rejected"></asp:ListItem>
                        <asp:ListItem Value="Discarded" Text="Discarded"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="title">
                    Applicant 申请人：
                </td>
                <td class="val">
                    <asp:TextBox ID="txtRequesterName" runat="server" CssClass="width140 txtbox" />
                </td>
            </tr>
            <tr class="ev-row">
                <td class="title">
                    Submit Date 申请提交日期：
                </td>
                <td class="val" colspan="3">
                    <asp:TextBox ID="txtCreateAtFrom" runat="server" CssClass="width140 txtbox datepicker" />&nbsp;To&nbsp;
                    <asp:TextBox ID="txtCreateAtTo" runat="server" CssClass="width140 txtbox datepicker" />
                </td>
            </tr>
            <tr class="ev-row">
                <td class="title">
                    Approved Date 审批通过日期：
                </td>
                <td class="val" colspan="3">
                    <asp:TextBox ID="txtDeptHeadDateFrom" runat="server" CssClass="width140 txtbox datepicker" />&nbsp;To&nbsp;
                    <asp:TextBox ID="txtDeptHeadDateTo" runat="server" CssClass="width140 txtbox datepicker" />
                </td>
            </tr>
            <tr class="ev-row">
                <td class="title">
                    Closed Date 关闭日期：
                </td>
                <td class="val" colspan="3">
                    <asp:TextBox ID="txtClosedDateFrom" runat="server" CssClass="width140 txtbox datepicker" />&nbsp;To&nbsp;
                    <asp:TextBox ID="txtClosedDateTo" runat="server" CssClass="width140 txtbox datepicker" />
                </td>
            </tr>
            <tr class="ev-row">
                <td class="title">
                    Contract No.：<br />
                    合同号&nbsp;&nbsp;
                </td>
                <td class="val">
                    <asp:TextBox ID="txtContractNo" runat="server" CssClass="width140 txtbox" />
                </td>
                <td class="title">
                    Is Domestic / Oversea Visit？<br />
                    国内 / 海外考察&nbsp;&nbsp;
                </td>
                <td class="val">
                    <asp:RadioButtonList ID="rblIsDomestic" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="all" Text="&nbsp;All&nbsp;&nbsp;"></asp:ListItem>
                        <asp:ListItem Value="1" Text="&nbsp;Domestic&nbsp;&nbsp;"></asp:ListItem>
                        <asp:ListItem Value="0" Text="&nbsp;Oversea&nbsp;&nbsp;"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        </table>
        <div class="padding_top5  txt_align_rgt">
            <asp:Button ID="btnSearch" runat="server" CssClass="btn" Text="Query (查询)" OnClick="btnSearch_Click" />
            <asp:Button ID="btnExport" runat="server" CssClass="btn" Text="Export to Excel (导出)" OnClick="btnExport_Click" />
        </div>
    </div>
    <asp:UpdatePanel ID="uplBody" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:DataGrid ID="dgList" ShowHeader="True" AutoGenerateColumns="False" GridLines="both" runat="server" PageSize="10" AllowPaging="True"
                PagerStyle-Visible="False" AllowSorting="True" CssClass="tablestyle" OnSortCommand="dgList_SortCommand">
                <ItemStyle CssClass="tbody trwhitebg" />
                <AlternatingItemStyle CssClass="tbody trpurplebg" />
                <HeaderStyle CssClass="thead" />
                <Columns>
                    <asp:TemplateColumn HeaderText="Application No.<br/> 申请单号" SortExpression="AppNo">
                        <ItemTemplate>
                            <a title="Open Application(打开申请单)" href="#" onclick="return openWindow('EZVRequest.aspx?id=<%# DataBinder.Eval(Container.DataItem,"AppID") %>')">
                                <%# DataBinder.Eval(Container.DataItem,"AppNo") %></a>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="EZVisit No.<br/>EZVisit单号" SortExpression="EZVisitReqNo">
                        <ItemTemplate>
                            <a href="#" title="Open Application(打开申请单)" onclick="return openWindow('ezvrequest.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"AppID") %>')">
                                <%# DataBinder.Eval(Container.DataItem, "EZVisitReqNo")%></a>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="RequesterNameEN" HeaderText="Applicant<br/>  申请人" SortExpression="RequesterNameEN" />
                    <asp:BoundColumn DataField="CreateAt" HeaderText="Application Date<br/>  申请日期" SortExpression="CreateAt" />
                    <asp:BoundColumn DataField="Company" HeaderText="Customer Company<br/>  客户公司" SortExpression="Company" />
                    <asp:BoundColumn DataField="RequestedDateFrom" HeaderText="Begin Date<br/>  开始时间" SortExpression="RequestedDateFrom" DataFormatString="{0:M/d/yyyy}" />
                    <asp:BoundColumn DataField="RequestedDateTo" HeaderText="End Date<br/>  结束时间" SortExpression="RequestedDateTo" DataFormatString="{0:M/d/yyyy}" />
                    <asp:TemplateColumn HeaderText="Status<br/> 状态" Visible="True">
                        <ItemTemplate>
                            <img width="20px" height="20px" src="../Images/Flag<%# DataBinder.Eval(Container.DataItem,"ProcessStatus") %>.gif" alt="<%# DataBinder.Eval(Container.DataItem,"ProcessStatus") %>"
                                title="<%# DataBinder.Eval(Container.DataItem,"ProcessStatus") %>" />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn HeaderText="Status<br/> 状态" DataField="ProcessStatus" Visible="false" />
                    <asp:BoundColumn Visible="False" DataField="Folio" />
                    <asp:BoundColumn Visible="False" DataField="AppID" />
                    <asp:BoundColumn Visible="False" DataField="CurrentStep" />
                </Columns>
            </asp:DataGrid>
            <div class="fw padding5 txt_align_rgt">
                <span class="float_lft">Total Records:
                    <asp:Label ID="lblRecordCount" runat="server" />
                    &nbsp;&nbsp;&nbsp;<img src="../images/book_open.gif" alt="Page (页码)" title="Page (页码)" />&nbsp;Page:
                    <asp:Label ID="lblCurrentPageIndex" runat="server" />&nbsp;/&nbsp;
                    <asp:Label ID="lblPageCount" runat="server" />
                </span><span>
                    <asp:ImageButton ID="btnPageFirst" runat="server" ImageUrl="~/images/pg_first_inact.gif" ImageAlign="AbsMiddle" ToolTip="First Page (第一页)"
                        OnClick="btnPageFirst_Click" />
                    &nbsp;
                    <asp:ImageButton ID="btnPagePrev" runat="server" ImageUrl="~/images/pg_pre_inact.gif" ImageAlign="AbsMiddle" ToolTip="Prev Page (上一页)"
                        OnClick="btnPagePrev_Click" />
                    &nbsp;
                    <asp:ImageButton ID="btnPageNext" runat="server" ImageUrl="~/images/pg_next.gif" ImageAlign="absmiddle" ToolTip="Next Page (下一页)"
                        OnClick="btnPageNext_Click" />
                    &nbsp;
                    <asp:ImageButton ID="btnPageLast" runat="server" ImageUrl="~/images/pg_last.gif" ImageAlign="absmiddle" ToolTip="Last Page (最后一页)"
                        OnClick="btnPageLast_Click" />
                    &nbsp; Go To Page:
                    <asp:TextBox ID="txtPage" runat="server" onmouseover="this.className='txtboxover width40';" onmouseout="this.className='txtbox width40';"
                        CssClass="txtbox width40" />
                    <asp:ImageButton ID="btnGotoPage" runat="server" ImageUrl="~/images/book_open.gif" ToolTip="Goto Page (转到)" OnClick="btnGotoPage_Click" /></span>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="dgList" EventName="SortCommand" />
            <asp:AsyncPostBackTrigger ControlID="btnGotoPage" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPageFirst" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPageLast" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPagePrev" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPageNext" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    </form>

    <script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function(sender, e) {
            $('.datepicker').datepicker({
                showOn: 'button',
                buttonImage: '../images/calendar.gif',
                buttonImageOnly: true,
                buttonText: 'Open Calendar (打开日历)'
            });
            $('#<%= this.dgList.ClientID %> .trwhitebg').mouseover(function() {
                $(this).removeClass('trwhitebg');
                $(this).addClass('trhover');
            }).mouseout(function() {
                $(this).removeClass('trhover');
                $(this).addClass('trwhitebg')
            });
            $('#<%= this.dgList.ClientID %> .trpurplebg').mouseover(function() {
                $(this).removeClass('trpurplebg');
                $(this).addClass('trhover');
            }).mouseout(function() {
                $(this).removeClass('trhover');
                $(this).addClass('trpurplebg');
            })
        });

        $(document).keyup(function(event) {
            if (event.keyCode == 13) {
                document.all.btnSearch.click();
                return false;
            }
        });
        function openWindow(url) {
            var w = screen.availWidth - 100;
            var h = screen.availHeight - 100;
            var top = 50;
            var left = 40;
            var title = 'win' + url.substr(url.indexOf('?') + 1).replace('=', '');
            window.open(url, title.toLowerCase(), 'scrollbars=yes,width=' + w + ',height=' + h + ',top=' + top + ',left=' + left + ',resizable=yes');
            return false;
        }
    </script>

</body>
</html>